package com.example.jikeyoujikeyou.office_sz.view.activity.main;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.example.jikeyoujikeyou.office_sz.R;
import com.example.jikeyoujikeyou.office_sz.model.Chat;
import com.example.jikeyoujikeyou.office_sz.view.base.BaseFragment;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class VContractFragment extends BaseFragment {

    private View activity_main_contract;
    private ListView contract_list;
    private ContractAdapter adapter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        activity_main_contract = inflater.inflate(R.layout.activity_main_contract,null,false);
        init();
        return activity_main_contract;
    }

    private void init() {
        contract_list = activity_main_contract.findViewById(R.id.contract_list);

        adapter = new ContractAdapter(getContext());
        Chat chat = null;
        DateFormat format = new SimpleDateFormat("hh:mm");
        for (int i = 0; i < 10; i++) {
            chat = new Chat("","姓名"+i,"技术经理","是否完成任务",format.format(new Date()));
            adapter.getChatList().add(chat);
        }

        contract_list.setAdapter(adapter);
    }

}
